package com.wms.util;

import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
import cn.hutool.crypto.symmetric.SymmetricCrypto;
public class DeCodeUtil {
    //随机生成密钥
    static byte[] key =new byte[] {-36, 45, -106, 23, -19, 35, 6, -102, 27, -33, -33, 40, -2, 34, 56, -68};

    //构建
    static SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, key);

    //加密为16进制表示
    //String encryptHex = aes.encryptHex(content);

    public static String decode(String password){
        String encryptHex=aes.encryptHex(password);
        return encryptHex;
    }


}


//import cn.hutool.crypto.symmetric.SymmetricAlgorithm;
//import cn.hutool.crypto.symmetric.SymmetricCrypto;
//
//public class DeCodeUtil {
//    // 随机生成密钥
//    static byte[] key = new byte[]{-36, 45, -106, 23, -19, 35, 6, -102, 27, -33, -33, 40, -2, 34, 56, -68};
//
//    // 构建
//    static SymmetricCrypto aes = new SymmetricCrypto(SymmetricAlgorithm.AES, key);
//
//    // 加密为16进制表示
//    // String encryptHex = aes.encryptHex(content);
//
//    public static String decode(String password) {
//        String encryptHex = aes.encryptHex(password);
//        return encryptHex;
//    }
//
//    // 添加一个main方法用于测试
//    public static void main(String[] args) {
//        String originalPassword = "123456"; // 替换为你想加密的密码
//        String encryptedPassword = decode(originalPassword);
//        System.out.println("原始密码: " + originalPassword);
//        System.out.println("加密后密码: " + encryptedPassword);
//    }
//}
